/**
 * @main.c
 *
 * @copyright This file create by rensuiyi ,all right reserve!
 *
 * @author rensuiyi
 *
 * @date 20-9-28 下午7:22
 */
#include "bsp/bsp_debug.h"
#include "bsp/bsp_led.h"
#include "bsp/bsp_lcd.h"
#include "includes.h"

static void task_deamon(void *para) {
  debug_info("deamon task\r\n");
  uint32_t *p = (uint32_t *)0x68005000;
  *p          = 0x02;

  extern void ili9320_test();
  ili9320_test();
  while (1) {
    vTaskDelay(pdMS_TO_TICKS(1000));
    bsp_led_toggle(BSP_LED_2);
    debug_info("12 %d\r\n", *p);
    *p = *p + 1;
  }
}

int main(void) {
  bsp_led_init();
  bsp_debug_init();
  bsp_lcd_init();

  debug_init(bsp_debug_port_send_string, DEBUG_INFO);

  debug_info("System start \r\n");

  xTaskCreate(task_deamon, "deamon", TASK_DEAMON_STACK_SIZE * 2, NULL, TASK_DEAMON_PRIORITY, NULL);
  debug_info("create task\r\n");
  vTaskStartScheduler();

  while (1) {
  }
}
